const mongoose = require('./db');

const userSchema = mongoose.Schema({
    username: String,
    password: String
});
const userModel = mongoose.model('user', userSchema);

const messageSchema = mongoose.Schema({
    receiverId: mongoose.Types.ObjectId,
    senderId: mongoose.Types.ObjectId,
    content: String,
    timestamp: { type: Date, default: Date.now }
});
const messageModel = mongoose.model('message', messageSchema);

module.exports = {
    userModel,
    messageModel
};
